package cn.ante.basic.mapper;


import cn.ante.basic.query.BaseQuery;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface BaseMapper<T> {

    /**
    * @Title: loadAll
    * @Description: 查询所有
    * @Author: Nai
    * @Version: 1.0
    * @Date:  2022/6/27 19:44
    * @Parameters: []
    * @Return java.util.List<T>
    */
    List<T> loadAll();

    /**
    * @Title: loadById
    * @Description: 根据id查询
    * @Author: Nai
    * @Version: 1.0
    * @Date:  2022/6/27 19:43
    * @Parameters: [id]
    * @Return T
    */
    T loadById(Long id);

    /**
    * @Title: add
    * @Description: 新增对象
    * @Author: Nai
    * @Version: 1.0
    * @Date:  2022/6/27 19:43
    * @Parameters: [t]
    * @Return void
    */
    void add(T t);

    /**
    * @Title: update
    * @Description: 修改对象
    * @Author: Nai
    * @Version: 1.0
    * @Date:  2022/6/27 19:43
    * @Parameters: [t]
    * @Return void
    */
    void update(T t);

    /**
    * @Title: remove
    * @Description: 根据id删除
    * @Author: Nai
    * @Version: 1.0
    * @Date:  2022/6/27 19:42
    * @Parameters: [id]
    * @Return void
    */
    void remove(Long id);

    /**
    * @Title: findAll
    * @Description: 高级查询条件查询所有
    * @Author: Nai
    * @Version: 1.0
    * @Date:  2022/6/27 19:42
    * @Parameters: [xxxQuery]
    * @Return java.util.List<T>
    */
    List<T> findAll(BaseQuery baseQuery);

    /**
    * @Title: pageCount
    * @Description: 查询总条数
    * @Author: Nai
    * @Version: 1.0
    * @Date:  2022/6/27 19:44
    * @Parameters: [xxxQuery]
    * @Return java.lang.Integer
    */
    Integer pageCount(BaseQuery baseQuery);

    /**
    * @Title: batchDel
    * @Description: 批量删除
    * @Author: Nai
    * @Version: 1.0
    * @Date:  2022/6/27 19:47
    * @Parameters: [ids]
    * @Return void
    */
    void batchDel(Long[] ids);
}
